<?php
defined('SYSTEM_PATH') OR exit('No direct script access allowed');
class Controller {

    //单例
    private static $instance;

    public function __construct()
    {
        self::$instance =& $this;
        //获取所有实例
        foreach (is_loaded() as $var => $class)
        {
            $this->$var =& load_class($class);
        }
        $this->load =& load_class('Loader', 'Libary');
        $this->load->initialize();
    }

    public static function &get_instance()
    {
        return self::$instance;
    }

}
